Skip to content

Add 'service type' verb#273

Merged
dirk-thomas merged 2 commits intoros2:masterfrom
artivis:feature/service_type
Jun 7, 2019
Merged

Add 'service type' verb#273
dirk-thomas merged 2 commits intoros2:masterfrom
artivis:feature/service_type

Conversation

@artivis
Copy link
Copy Markdown
Contributor

@artivis artivis commented Jun 7, 2019

Add the type verb to service which return the type of a given service.
E.g.
given ros2 run demo_nodes_cpp talker

$ ros2 service type /talker/describe_parameters
rcl_interfaces/srv/DescribeParameters

Signed-off-by: artivis <jeremie.deray@canonical.com>
Comment thread ros2service/ros2service/verb/type.py Outdated

for (service_name, service_types) in service_names_and_types:
if args.service_name == service_name:
print(service_types[0])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this only print the first type? (I guess the same question applies to the previous topic PR.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, can it really have several types ?? If so then this is a mistake.
I only print the first one for a formatting purpose, I could do the same with a loop I guess.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it really have several types ??

Yes, it can have multiple types. That is why the API returns a list of type names.

I could do the same with a loop I guess.

👍 one type per line sounds good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: artivis <jeremie.deray@canonical.com>
@artivis artivis mentioned this pull request Jun 7, 2019
@dirk-thomas
Copy link
Copy Markdown
Member

Thanks for the feature addition.

Build Status

@dirk-thomas dirk-thomas merged commit 9e1cb8d into ros2:master Jun 7, 2019
@artivis artivis deleted the feature/service_type branch June 11, 2019 20:51
@kyrofa kyrofa mentioned this pull request Sep 4, 2019
34 tasks
esteve pushed a commit to esteve/ros2cli that referenced this pull request Dec 16, 2022
* Assert the client call succeeded

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>

* Shutdown rclpy when test throws exceptions

Signed-off-by: Shane Loretz <sloretz@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants